<template>
  <div id="app">
    <div class="container">
      <div class="header">
        <div class="main">
          <div class="logo">
            <img src="./assets/logo.png"/>
          </div>
          <div class="user">
            <i class="el-icon-service"></i>
            <span class="logout" @click="logout" title="点击退出登录">{{userName}}</span>
          </div>
        </div>
      </div>
      <div class="main">
        <div class="main">
          <router-view></router-view>
        </div>
      </div>
      <div class="footer">
        <div class="main">
          <p>蜀IPC备 18000424号-1 成都珀斯信息技术有限公司&copy; 版权所有</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import {getCookie, clearCookie} from './util/cookie';

  export default {
    name: 'App',
    data() {
      return {
        userName: getCookie('name')
      }
    },
    methods: {
      logout() {
        clearCookie()
        this.$router.push('/login')
      }
    }
  }
</script>

<style scoped>
  .logout {
    cursor: pointer;
  }

  .logout:hover {
    font-weight: 800;
  }

  .container {
    min-width: 1000px;
  }

  .container > .header {
    position: fixed;
    padding: 5px 0;
    height: 50px;
    width: 100%;
    z-index: 1010;
    background-color: white;
    border-bottom: 1px solid #DEDFDC;
  }

  .container > .header > .main {
    height: 100%;
    width: 100%;
    position: relative;
  }

  .container > .header > .main > .logo {
    float: left;
    width: 200px;
    height: 100%;
    text-align: center;
  }

  .container > .header > .main > .logo > img {
    height: 100%;
    max-width: 100%;
  }

  .container > .header > .main > .user {
    float: right;
    height: 100%;
    line-height: 50px;
    padding-right: 20px;
  }

  .container > .main {
    height: 100%;
    width: 100%;
  }

  .container > .main > .main {
    padding: 60px 0 40px 0;
  }

  .container > .footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 40px;
    font-size: 12px;
    text-align: center;
    z-index: 1010;
    background-color: white;
  }

  .container > .footer > .main {
    width: 1000px;
    height: 100%;
    margin: 0 auto;
    border-top: 1px solid #DEDFDC;
  }

  /*!*滚动条样式*!*/
  /*.main::-webkit-scrollbar { !*滚动条整体样式*!*/
  /*width: 8px; !*高宽分别对应横竖滚动条的尺寸*!*/
  /*height: 4px;*/
  /*}*/

  /*.main::-webkit-scrollbar-thumb { !*滚动条里面小方块*!*/
  /*border-radius: 5px;*/
  /*-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);*/
  /*background: rgba(0, 0, 0, 0.2);*/
  /*}*/

  /*.main::-webkit-scrollbar-track { !*滚动条里面轨道*!*/
  /*-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);*/
  /*border-radius: 0;*/
  /*background: rgba(0, 0, 0, 0.1);*/
  /*}*/
</style>
